<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Talent extends Model
{
    const INTERVIEW_STATUS_NAME = [
        0 => '未匹配',
        1 => '待面试', // 出现在待面试中，指定一面面试批次
        2 => '一面中',
        3 => '一面未通过',
        4 => '一面缺席',
        5 => '一面通过', // 出现在待二面中，指定二面面试批次
        6 => '二面中',
        7 => '二面未通过',
        8 => '二面缺席',
        9 => '二面通过', // 出现在待HR终面中，指定HR终面面试批次
        10 => 'HR终面中',
        11 => 'HR终面未通过',
        12 => 'HR终面缺席',
        13 => 'HR终面通过',
    ];

    const OFFER_STATUS_NAME = [
        0 => '未录用',
        1 => '已录用',
    ];

    const WAIT_STATUS_NAME = [
        0 => '未联系',
        1 => '安排面试',
        2 => '已联系未安排',
        3 => '无法联系',
    ];

    protected $table = 'talent';

    protected $dateFormat = 'U';

    protected $guarded = [];

    public function first_batch_info()
    {
        return $this->belongsTo(Batch::class, 'first_batch_id', 'id');
    }

    public function second_batch_info()
    {
        return $this->belongsTo(Batch::class, 'second_batch_id', 'id');
    }

    public function hr_batch_info()
    {
        return $this->belongsTo(Batch::class, 'hr_batch_id', 'id');
    }
}
